#!/bin/bash

while :
do
nc -z 192.168.0.189 21 &>/dev/null
if (( $? ==0 ))
then
	echo "192.168.0.189 is ok"
	#echo "服务器正常" >>/var/log/monitor_ftp.log
else
	echo " 服务器 192.168.0.189 warnning"
	echo "`date +%F_%H_%M_%S` 服务器 192.168.0.189 warnning " >>/var/log/monitor_ftp.log
	sleep 1
fi 	
done
